package com.mercator.client.graph;

import org.vaadin.gwtgraphics.client.DrawingArea;
import org.vaadin.gwtgraphics.client.shape.Rectangle;

public class PhenomeNode extends StringNode<GenClique,PhenomeNode,Rectangle> {
	public int WIDTH = 80;
	public PhenomeNode(DrawingArea canvas, GenClique element) {
		super(canvas, element);
		radius = 80;
	}
	
	public void unselect(){
		super.unselect();
		rep.setStrokeColor("green");
		rep.setFillColor("white");
	}
	@Override
	public void select(){
	//	System.out.println(this);
		System.out.println("Center:(" + getCenterX() +  getTargetCenterX()+ ")");
	}

	@Override
	public PhenomeNode getThis() {
		return this;
	}

	@Override
	public int hashcode() {
		return element.hashCode();
	}

	@Override
	protected Rectangle getShape() {
		return new Rectangle(0,0,radius,radius);
	}
	
	public boolean containsAll(PhenomeNode n){
		return element.containsAll(n.element);
	}

	@Override
	public boolean equals(PhenomeNode n) {
		return element.equals(n.element);
	}

	public int size(){
		return this.element.genesets.size();
	}
	
	@Override
	protected void setSize(int x, int y) {
		getShape().setWidth(x);
		getShape().setHeight(y);
	}

}
